/**
 * Project Name:fastPlat
 * File Name:MemberFavoritesServiceImpl.java
 * Package Name:com.fast.user.service.member.impl
 * Date:2017年05月27日 17时59分48秒
 * Copyright (c) 2017, lsflu@126.com All Rights Reserved.
 *
*/

package com.fast.user.service.member.impl;

import org.springframework.stereotype.Service;

import com.fast.base.dao.daoSuport.JpaDaoSupport;
import com.fast.base.db.page.PageView;
import com.fast.base.db.page.QueryResult;
import com.fast.user.service.member.MemberFavoritesService;
import com.fast.user.web.form.web.MemberFavoritesForm;
import com.fast.user.model.member.MemberFavorites;

/**
 * ClassName:MemberFavoritesServiceImpl <br/>
 * 用途: 用户收藏记录服务实现 <br/>
 * 开发人员：lushuifa  http://lushuifa.iteye.com/
 * 邮箱:lsflu@126.com
 * @version  1.0
 * @since    JDK 1.6
 * @see
 * Date:     2017年05月27日 17时59分48秒 <br/> 	 
 */
@Service("memberFavoritesService")
public class MemberFavoritesServiceImpl extends JpaDaoSupport implements MemberFavoritesService {

    /**
	 * 分页获取用户收藏记录列表
	 * @return PageView<MemberFavorites>
	 */
	@Override
	public PageView<MemberFavorites> getMemberFavoritesList(MemberFavoritesForm memberFavoritesForm){
		StringBuffer sb = new StringBuffer(" where 1=1 ");
		sb.append("and delete_flag="+memberFavoritesForm.getDeleteFlag()+" ");
		String ordersql = " order by edit_time desc ";
		QueryResult<MemberFavorites>  queryResult = super.queryForBeanListByPage(MemberFavorites.class,sb.toString(),ordersql,(memberFavoritesForm.getPage()-1)*memberFavoritesForm.getRows(),memberFavoritesForm.getRows());
		PageView<MemberFavorites> pageView = new PageView<MemberFavorites>();
	    pageView.setCurrentPage(memberFavoritesForm.getPage());
		pageView.setQueryResult(queryResult);
 		return pageView;
	}
}

